unit UnLokatieTypen;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,UnDatamodule, ExtCtrls, StdCtrls, DBCtrls, Grids, DBGrids, Mask, DB;

type
  TLokatieTypen = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Panel3: TPanel;
    DsLokatieTypen: TDataSource;
    DBEdit1: TDBEdit;
    DBGrid1: TDBGrid;
    DBNavigator1: TDBNavigator;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    aDmDataSets : TDmDataSets;
  public
    property DmDataSets : TDmDataSets read aDmDataSets write aDmDataSets;
  end;

var
  LokatieTypen: TLokatieTypen;

implementation

{$R *.dfm}

procedure TLokatieTypen.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if DmDataSets.CdsLokatieTypen.State in [dsEdit,dsInsert] then
  begin
    if MessageDlg('Wijzigingen opslaan?',mtConfirmation,mbYesNo,0) = mrOk then
    begin
      DmDataSets.CdsLokatieTypen.Post;
      DmDataSets.CdsLokatieTypen.Refresh;
    end;
  end;
  Action := caFree;
end;

end.
